//
// Created by Semir on 2020/6/1.
//

#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int getDigitAtIndex(int index) {
    int stride = 9;
    int bitCnt = 1;
    int origin = index;
    while (index - stride * bitCnt > 0) {
        index -= stride * bitCnt;
        stride *= 10;
        bitCnt++;
    }
    index--;
    int start = pow(10, bitCnt - 1);
    int num = index / bitCnt + start;
    int i = index % bitCnt;
    string str = to_string(num);
    return str[i] - '0';
}

int main() {
    int res = getDigitAtIndex(10);
    cout << res << endl;
    return 0;
}